package IT03;

import java.util.Calendar;
import java.util.Scanner;

/*
每年的二月份有多少天
 */
public class CalendarText {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入年份：");
        int year = sc.nextInt();
        Calendar c = Calendar.getInstance();
        c.set(year,2,1);
        //3.1往前一天就是2月的最后一天
        c.add(Calendar.DATE,-1);
        //获取这一天输出
        int date = c.get(Calendar.DATE);
        System.out.println(year + "年的2月份有" + date + "天");
    }
}
